import { toJSONSchema } from "mockjs"

let storage = {
    set: function (key:string, data:any) {
        try{

            localStorage.setItem(key,JSON.stringify(data))
        }catch(e){
            localStorage.setItem(key,data)
        }
    },

    get: function (key:string) {
        try{
            let str = localStorage.getItem(key) as any
            return JSON.parse(str)
        }catch(e){
            return localStorage.getItem(key)
        }
    }
}

export default storage